package com.cisite.web.core

import java.io.Serializable;
/**
 * description: 频道
 *
 * @author 展醉
 * @2012-6-3 上午11:20:31
 */
class Channel implements Serializable{
  /**
 * @field channelName 频道名称
 */
String channelName;
  /**
 * @field visitPath 访问路径
 */
String visitPath;
  int priority = 1;
  /**0非静态化  1静态化*/
  boolean isStaticChannel = false
  boolean isStaticCont = false
  int pageSize = 20
  String link;
  /**栏目页模版**/
  String tplChannel
  /**内容页模版**/
  String tplCont
  /**标题是否有缩略图**/
  boolean hasTitleImg = false
  /**内容是否有缩略图**/
  boolean hasContImg = false
  boolean isComment = false
  boolean isUpdown = false
  boolean isBlank = false
  String metaTitle
  String metaKeyWords
  String metaDescript
  
  static belongsTo = [parent:Channel,manager:Manager]
  static hasMany = [channels:Channel];
  
  static constraints = {
	  channelName(size:2..50,Blank:false)
	  visitPath(size:2..20,Blank:false)
	  priority(matches:/\d{1,2}/,nullable:true)
	  isStaticChannel(nullable:true)
	  isStaticCont(nullable:true)
	  pageSize(nullable:true)
	  link(nullable:true)
	  tplChannel(nullable:true)
	  tplCont(nullable:true)
	  hasTitleImg(nullable:true)
	  
	  hasContImg(nullable:true)
	  isComment(nullable:true)
	  isUpdown(nullable:true)
	  isBlank(nullable:true)
	  metaTitle(nullable:true)
	  metaKeyWords(nullable:true)
	  metaDescript(nullable:true)
  }
  
  static mapping = {
	  version false
	  cache true
  }
}
